package com.zczc.web;

import com.github.pagehelper.PageInfo;
import com.zczc.entity.MessageGetter;
import com.zczc.service.MessageGetterService;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

/**
 * @Author:Mark
 * @Description:
 * @Date: Created on 10:07 2018-12-13
 * @Modify by:
 */
@SpringBootTest
@RunWith(SpringRunner.class)
public class RunTestCC {

  @Autowired
  private MessageGetterService messageGetterService;


  @Test
  public void testaddMessageGet() throws Exception {
    MessageGetter messageGetter=new MessageGetter();
    messageGetter.setUserId("111");

    String msg=messageGetterService.addMessageGetterSelective(messageGetter)?"成功":"失败";
    System.out.println(msg);
  }

  @Test
  public void testselMessageGet() throws Exception {
    MessageGetter messageGetter=new MessageGetter();
    messageGetter.setUserId("666");

    PageInfo<MessageGetter> messageGetterPageInfo = messageGetterService
        .selectMessageByUserId(messageGetter, null, null);
    System.out.println("结果为======================"+messageGetterPageInfo.getList());
  }


  @Test
  public void testreadlMessageGet() throws Exception {
  /*  MessageGetter messageGetter=new MessageGetter();
    messageGetter.setUserId("666");*/
    List<String> ids =new ArrayList<>();
    ids.add("5fa5ae23-cf8d-4755-878b-30d1b3ec612f");
    ids.add("7c34d56c-5308-4c59-b322-4b131a6886ae");

    String msg=messageGetterService.deleteMessageByIdLogic(ids,"666")?"成功":"失败";

    System.out.println("结果为======================"+msg);
  }


}
